<template>
	<view>
		<view class="tui-actionsheet" :class="[show ? 'tui-actionsheet-show' : '']" >
			<view class="regional-selection">
				<view class="specs">
				  <view class="specs-top pl-5 justify-between pb-20" style="padding-top: 40rpx;font-size: 36rpx;color: #222222;">
					 <u-icon name="close" @click="docoupon()"></u-icon>
				     <view >优惠券</view>
					 <view class="">
					 	
					 </view>
				  </view>
				  <view class="class_empty">
				  	  <text class="no_coupon">不使用优惠券</text>
					  <u-icon  color="#2979ff" size="26" :name="api_image+'/uplaod/20250606/05d9e8073454590b505186ad266db133cc0377c1.png'" @click="docoupon()"></u-icon>
				  </view>
				  <block v-if="allTabList.length > 0">
				  	<view :class="[currentTab == 0 ? 'new-list-item' : 'new-list-item1']" v-for="(item,index) in allTabList" :key="index">                        
				  		<view :class="[currentTab == 0 ? 'coupon_left' : 'coupon_left1']" style="flex-direction: column;">    		 
				  			<view class="coupon_amount">
						     	<text>{{item.amount}}</text>
								<text style="font-size: 28rpx;color: #36B3E9;">元</text>
							</view>  
							<view class="coupon_infos">
								<text>{{item.coupon_info}}</text>
							 </view>
				  		</view>	
						<view class="flex justify-between" style="width: 71%;position: relative;padding-left: 20rpx;">
							 <view class="coupon_info">
								<view class="mt-15" style="font-weight: 600;font-size: 32rpx;color: #222222;">{{item.coupon_name}}</view>  
								<view class="mt-15" style="color: #36B3E9;position: absolute;top: 65rpx;font-size: 24rpx;">有效期：{{item.start_time}} 至 {{item.end_time}}</view> 
								<!-- <view class="mt-15">{{item.coupon_info}}</view>  	 -->								 	
							 </view>
							 
							 <view class="flex align-center" style="width: 160rpx;position: absolute;font-size: 24rpx;color: #888888;margin-top: 75px;" @click="docouponInfo(item)">
							 	<text>使用说明</text>
							 	<u-icon name="arrow-right" :color="[item.use_status == 0?'#888888':'#BBBBBB']" size="15"></u-icon>
							 </view>
							 
							 
							 <view class="flex" style="margin-top: 130rpx;margin-right: 10rpx;" v-if="currentTab==0" @click="docoupon(item)">
								<u-button class="custom-style" iconColor="#36B3E9 " color="#36B3E9 " shape="circle" text="去使用" size="small"></u-button> 					 
							 </view>						 	
						 </view>
				  		 <view class="flex" style="margin-top: 60rpx;margin-right: 80rpx;" v-if="currentTab>0">
				  		 	<!-- <u-button class="custom-style" iconColor="#FFA200" color="#FFA200" shape="circle" text="去使用" size="small"></u-button> -->					 
				  		 </view>
				  	</view>
				  </block>    
				</view>
			</view>
		</view>
		<!-- 遮罩层 -->
		<view class="tui-actionsheet-mask"  :class="[show ? 'tui-mask-show' : '']"  @tap="handleClickMask"></view>
	</view>
</template>
 
<script>
export default {
  // name: "tuiActionsheet",
  props: {
    //点击遮罩 是否可关闭
    maskClosable: {
      type: Boolean,
      default: true,
    },
    //显示操作菜单
    show: {
      type: Boolean,
      default: false,
    },
	orderType:{
		ype: String
	}
  },
  data(){
	  return {
		  ...getApp().globalData.config,
		  allTabList:[],
		  currentTab:0
	  }
  },
methods:  {
   
    handleClickMask() {
		 this.$emit("CancelCoupon",false);
    },
	
	//地址信息
	showSpecs(events){
		console.log('events---',events)
		this.allTabList=events
	},
	//选中地址
	docoupon(events){
		this.$emit('chooseCoupon',events)
	},
	//使用优惠券详情
	docouponInfo(item){					
		this.$routers.router('/pages/pagesuser/coupon/info?parms='+JSON.stringify(item),'navigateTo') 
	},
    
   
  },
};
</script>
 
<style scoped lang="less">
	.class_empty{
		display: flex;
		margin-top: 10rpx;
		margin-left: 20rpx;
		margin-right: 20rpx;
		margin-bottom: 20rpx;
		width: 635rpx;
		height: 108rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		justify-content: space-between;
		align-items: center;
		text-align: center;
		padding-left: 20rpx;
		padding-right: 20rpx;
	}
	.coupon_infos{
		margin-top: 20rpx;
		font-weight: 400;
		font-size: 24rpx;
		color: #36B3E9;
	}
	
	.node-tab{
	 /* background-color: #ffffff; */
	  height:88rpx;
	  font-size:28rpx;
	  line-height: 88rpx;
	  display: flex;
	}
	.node-tab .tab-item{
	  flex:1;
	  text-align: center;
	  color: #666;
	}
	.node-tab .active{
	  color: #FFA200;
	  position: relative;
	}
	.node-tab .active::before{
	  position:absolute;
	  content: " ";
	  bottom:10rpx;
	  left: 50%;
	  transform: translateX(-50%);
	  width: 30rpx;
	    height: 6rpx;
	    background-color: #FFA200;
	    border-radius: 3rpx;
	}
	
	.new-list-item {
	  box-sizing:border-box;
	  /* height:260rpx; */
	  position: relative;
	 /* background-color: #fff; */
	  margin-bottom: 20rpx;
	  margin-top: 10rpx;
	  margin-left: 20rpx;
	  margin-right: 20rpx;
	/*  padding: 20rpx 30rpx 0; */
	  display: flex;
	  flex-direction: row;
	  justify-content: space-between;
	  background-image: url('https://image.workair.top/uplaod/20250606/f088e7bb0b595513dfd4d32f18b34e3f2cb8fe0f.png');
	  background-repeat: repeat;
	  background-size: 100% 100%;
	}
	
	.new-list-item1{
		box-sizing:border-box;
		  /* height:260rpx; */
		  position: relative;
		 /* background-color: #fff; */
		  margin-bottom: 20rpx;
		  margin-top: 10rpx;
		  margin-left: 20rpx;
		  margin-right: 20rpx;
		/*  padding: 20rpx 30rpx 0; */
		  display: flex;
		  flex-direction: row;
		  justify-content: space-between;
		  background-image: url('https://image.workair.top/uplaod/20250606/f088e7bb0b595513dfd4d32f18b34e3f2cb8fe0f.png');
		  background-repeat: repeat;
		  background-size: 100% 100%;
	}
	
	.new-list-item:last-child {
	  margin-bottom: 0;
	}
	
	.new-list-item view {
	  box-sizing: border-box;
	}
	.coupon_left{
		display: flex;
		margin-top: 90rpx;
		flex-direction: row;
		align-items: center;
		vertical-align: center;
		justify-content: center;
		margin-left: 40rpx;
		margin-bottom: 90rpx;
		color: #FFFFFF;
	}
	.coupon_left1{
		display: flex;
		margin-top: 90rpx;
		flex-direction: row;
		align-items: center;
		vertical-align: center;
		justify-content: center;
		margin-left: 40rpx;
		margin-bottom: 90rpx;
		color: rgba(1, 31, 55, 0.6);
	}
	.coupon_tag{
		font-weight: 400;
		font-size: 32rpx;
		
		line-height: 7rpx;
	}
	.coupon_amount{
		font-weight: bold;
		font-size: 52rpx;
		color: #36B3E9;
		margin-left: 15rpx;
		margin-top: -17rpx;
		font-size: 60rpx;
		line-height: 7rpx;
	}
	.coupon_info{
		display: flex;
		flex-direction: column;
		margin-top: 10rpx;
		padding-left: -10rpx;
		font-size: 27rpx;
	}
	
	.coupon_info1{
		display: flex;
		flex-direction: column;
		margin-top: 10rpx;
		margin-left: -250rpx;
		font-size: 28rpx;
	}
	
	
.tui-actionsheet {
  width: 100%;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  visibility: hidden;
  transform: translate3d(0, 100%, 0);
  transform-origin: center;
  transition: all 0.3s ease-in-out;
  background: #F0F9FE ;
  min-height: 100rpx;
  border-radius: 32rpx 32rpx 0rpx 0rpx;
}
 
.tui-actionsheet-show {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}
.regional-selection {
    // text-align: center;
  // height: 400rpx;
  // background: #fff;
   border-radius: 16rpx;
   padding-bottom: 110rpx;
   
}
.tui-actionsheet-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9996;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
}
 
.tui-mask-show {
  opacity: 1;
  visibility: visible;
}

/* component/specs/index.wxss */
.specs{
  padding: 0 20rpx;
  align-items: flex-end;

}

.productNameText{color:rgb(32,27,27);font-size:35rpx;text-overflow:ellipsis;z-index:-1;display:-webkit-box;word-break:break-all;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;}

.specs-top{
  display: flex;
  flex-direction: row;
  font-size: 23rpx;
  justify-content:space-between;
  padding-bottom: 20rpx;
  padding-top: 25rpx;
  // border-bottom: 1rpx solid rgb(240, 235, 235);
}
.specs-image {
  width: 152rpx !important;
  height: 152rpx !important;
  background: rgba(0, 0, 0, 0);
  border: 1rpx solid #E5E9E8;
  border-radius: 16rpx;
}

.specs-title {
  font-size: 30rpx;
  color: #333333;
  opacity: 1;
  margin: 30rpx 0 20rpx 0;
}

.specs-cell{
  display: flex;
  flex-wrap: wrap;
}

.specs-name {
  color: #888888;
  border: 1rpx solid #888888;
  border-radius: 10rpx;
  padding: 15rpx 20rpx;
  font-size: 28rpx;
  margin-right: 15rpx;
  margin-bottom: 20rpx;
}

.specs-goods-name {
  font-size: 32rpx;
  line-height: 40rpx;
  margin-bottom: 10rpx;
}

.specs-goods {
  font-size: 28rpx;
  line-height: 40rpx;
  color: gray;
  margin-bottom: 20rpx;
}
.specs_name{
  margin-top: 40rpx;
  width: 62%;
  border-bottom: 1rpx solid rgb(240, 235, 235);
  
}

.specs-price {
  font-size: 38rpx;
  color: #EE4D52;
  margin-left: -5rpx;
}

.specs-num {
  font-size: 28rpx;
  color: #999999;
}

.submit-btn-left {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  min-width: 240rpx;
  width: 100%;
  height: 76rpx;
  opacity: 1;
  border-radius: 38rpx 0 0 38rpx;
}

.submit-btn-right {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  min-width: 240rpx;
  width: 100%;
  height: 76rpx;
  opacity: 1;
  /* border-radius: 0 38rpx 38rpx 0;
  margin-top: 2rpx; */
}
.specs{
 
    margin-bottom: -44rpx;
    
}
.main-bottom{
  display: flex;
  flex-direction:column;
}
</style>